﻿<UserControl x:Class="Tanmia.Controls.ContactDetailTool"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" FlowDirection="RightToLeft" Loaded="UserControl_Loaded"
             xmlns:la="clr-namespace:Tanmia.Basis.WPF.Controls;assembly=Tanmia.Basis"
             d:DesignHeight="200" d:DesignWidth="200">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="214*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="6" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <ListBox Name="lstContactDetail" SelectionChanged="lstContactDetail_SelectionChanged" KeyDown="lstContactDetail_KeyUp" Margin="0,0,0,6" BorderThickness="0" Grid.ColumnSpan="2">
            <ListBox.ItemContainerStyle>
                <Style TargetType="ListBoxItem">
                    <Setter Property="Height" Value="30"/>
                    <Setter Property="BorderBrush">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFEEC958" Offset="0" />
                                <GradientStop Color="#FFF2D757" Offset="1" />
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    <Setter Property="BorderThickness" Value="1.5"/>
                    <Setter Property="Margin" Value="2"/>
                    <Setter Property="Background">
                        <Setter.Value>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FFFBF9E0" Offset="1" />
                                <GradientStop Color="#FFFBEDB3" Offset="0" />
                                <GradientStop Color="#FFFAE48F" Offset="0.241" />
                                <GradientStop Color="#FFF9E493" Offset="0.689" />
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                    <Style.Resources>
                        <LinearGradientBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF5C866" Offset="0" />
                            <GradientStop Color="#FFFEE287" Offset="1" />
                            <GradientStop Color="#FEFFE48A" Offset="0.07" />
                        </LinearGradientBrush>
                    </Style.Resources>
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFF5C866" Offset="0" />
                                        <GradientStop Color="#FFFEE287" Offset="1" />
                                        <GradientStop Color="#FEFFE48A" Offset="0.07" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFC29E47" Offset="1" />
                                        <GradientStop Color="#FFC2762B" Offset="0" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Foreground" Value="Black"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ListBox.ItemContainerStyle>
            <ListBox.ContextMenu>
                <ContextMenu>
                    <MenuItem Click="btnSave_Click" Header="جديد"/>
                    <MenuItem IsEnabled="False" Header="تعديل"/>
                    <MenuItem Click="btnDelete_Click" Header="حذف"/>
                </ContextMenu>
            </ListBox.ContextMenu>
        </ListBox>
        <Border Margin="0,0,0,6"  BorderBrush="#FF9DC1E6" BorderThickness="1.9" CornerRadius="3" Grid.ColumnSpan="2" />

        <Label Name="lblType" Content="النوع: " Grid.Row="1" IsEnabled="False" />
        <ComboBox Name="cmbType" SelectionChanged="cmbType_SelectionChanged" Margin="4,2,0,1" Grid.Row="1" Grid.Column="1" IsEnabled="False" />

        <Label Name="lblValue" Content="القيمة: " Grid.Row="3" IsEnabled="False" />
        <TextBox Name="txtValue" Margin="4,2,0,1" Grid.Row="3" Grid.Column="1" IsEnabled="False" />

        <Label Name="lblNote" Content="ملاحظات: " Grid.Row="5" IsEnabled="False" />
        <TextBox Name="txtNote"  Height="35" Margin="4,2,0,3" Grid.Row="5" Grid.Column="1" AcceptsReturn="True" AcceptsTab="True" VerticalScrollBarVisibility="Visible" IsEnabled="False" />

        <Grid Grid.Row="7" Grid.ColumnSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="8" />
                <ColumnDefinition Width="75" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Button Name="btnSave" Focusable="False" IsDefault="True" Content="إضافة" Grid.Column="1" Height="25" Click="btnSave_Click" />
            <Button Name="btnDelete" Focusable="False" Content="حذف" Height="25" Grid.Column="3" Click="btnDelete_Click" />
        </Grid>
    </Grid>
</UserControl>
